package common.Utils;

import java.util.Collection;
import java.util.LinkedList;

public class LinkedSet<T> extends LinkedList<T> 
{
	private static final long serialVersionUID = 6943942820176767577L;
	
	@Override
	public boolean add(T item)
	{
		boolean retVal = false;
		
		if(!contains(item))
			retVal = super.add(item);
		
		return retVal;
	}
	
	public boolean addCollection(Collection<T> c)
	{
		boolean retVal = false;
		
		if(c != null)
		{
			for(T item : c)
				if(!contains(item))
					retVal = super.add(item);
		}
		
		return retVal;
	}
}
